<template>
  <div class="dialog-container">
    <div class="dialog-content">
      <el-form ref="elForm" :model="form" size="mini" label-width="120px">
        <el-form-item label="我方id:" prop="f_id ">
          <el-input placeholder="信息编号" v-model="form.f_id"> </el-input>
        </el-form-item>
        <el-form-item style="margin-bottom: 0; margin-top: 40px">
          <div class="panel-line flex-end">
            <el-button :loading="loading" type="danger" @click="onDelete" v-if="sts === 3">删除</el-button>
            <el-button @click="onCancel">取消</el-button>
            <el-button :loading="loading" type="primary" @click="onSubmit">确定</el-button>
          </div>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
export default {
  name: 'DialogContrast',
  props: {
    sts: Number,
    fId: String,
  },
  data() {
    return {
      loading: false,
      form: {
        f_id: '',
      },
    }
  },
  mounted() {
    this.form.f_id = this.fId
  },
  destroyed() {},
  methods: {
    // 取消
    onCancel() {
      this.$emit('close')
    },
    // 确定
    onSubmit() {
      this.loading = true
      this.$emit('submit', this.form.f_id)
    },
    // 删除
    onDelete() {
      this.loading = true
      this.$emit('delete')
    },
    handleDone() {
      this.loading = false
    },
  },
}
</script>
